package com.atguigu.gmall.common.util;

import com.atguigu.gmall.cart.vo.UserAuth;
import com.atguigu.gmall.common.constant.RedisConst;

import javax.servlet.http.HttpServletRequest;

/**
 * @author lfy
 * @Description
 * @create 2023-07-31 14:22
 */
public class UserAuthUtil {

    public static UserAuth getUserAuth(){
        HttpServletRequest request = HttpUtil.currentRequest();
        String userid = request.getHeader(RedisConst.USER_ID_HEADER);
        String tempid = request.getHeader(RedisConst.USER_TEMPID_HEADER);
        return new UserAuth(userid,tempid);
    }
}
